package game

import "sync"

type Player struct {
	ModPlayer     *ModPlayer
	ModIcon       *ModIcon
	ModCard       *ModCard
	ModUniqueTask *ModUniqueTask
	ModRole       *ModRole
}

// TODO:测试，可删
func NewTestPlayer() *Player {
	player := new(Player)
	player.ModPlayer = new(ModPlayer)
	player.ModIcon = new(ModIcon)
	player.ModCard = new(ModCard)
	player.ModUniqueTask = new(ModUniqueTask)
	player.ModUniqueTask.Locker = new(sync.RWMutex)
	player.ModRole = new(ModRole)
	player.ModPlayer.PlayerLevel = 1 // 初始等级
	return player
}

// 接收客户端传来的更改图标的消息
func (self *Player) RecvSetIcon(iconId int) {
	self.ModPlayer.SetIcon(iconId, self)
}

// 接收客户端传来的更改名片的消息
func (self *Player) RecvSetCard(cardId int) {
	self.ModPlayer.SetCard(cardId, self)
}

// 接收客户端传来的更改名字的操作
func (self *Player) RecvSetName(name string) {
	self.ModPlayer.SetName(name, self)
}

// 接收客户端传来的更改签名的操作
func (self *Player) RecvSetSign(sign string) {
	self.ModPlayer.SetSign(sign, self)
}

// 降低世界等级
func (self *Player) RecvReduceWorldLevel() {
	self.ModPlayer.ReduceWorldLevel()
}

// 返回原先的世界等级
func (self *Player) RecvRevertWorldLevel() {
	self.ModPlayer.RevertWorldLevel()
}

func (self *Player) RecvSetBirth(birth int) {
	self.ModPlayer.SetBirth(birth, self)
}

func (self *Player) SetShowCard(showCard []int) {
	self.ModPlayer.SetShowCard(showCard, self)
}

func (self *Player) SetShowTeam(showTeam []int) {
	self.ModPlayer.SetShowTeam(showTeam, self)
}

func (self *Player) SetHideShowTeam(isHide int) {
	self.ModPlayer.SetHideShowTeam(isHide)
}

// 空的测试，防止player不调用导致报错
func (self *Player) EmptyFunc() {
	// 空方法
}
